package com.hx.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.hx.pojo.User;
import com.hx.pojo.UserRepository;
@Component
public class UserService {
	@Autowired
	private UserRepository ur;
	
	public boolean findUser(User user){
		List<User> us=ur.findByNameAndPassword(user.getName(), user.getPassword());
		for (User u : us) {
			System.out.println(u.getName()+"   "+u.getPassword());
		}
		if(us!=null&&us.size()>0){
		  return true;	}	
		  return false;
	}
}
